package com.ellricky.baselib.util;

import android.content.Context;

import com.andr.common.ui.dialog.listener.OnMyAlertListener;
import com.andr.common.util.ResUtil;
import com.ellricky.baselib.R;
import com.ellricky.baselib.dialog.ClassHourDialog;
import com.ellricky.baselib.dialog.DelConfirmDialog;
import com.ellricky.baselib.dialog.ScanDialog;
import com.ellricky.baselib.dialog.TakePhotoDialog;
import com.ellricky.baselib.dialog.TextDialog;
import com.ellricky.baselib.listener.OnBackScanListener;
import com.ellricky.baselib.listener.OnClassHourConfirmListener;
import com.ellricky.baselib.listener.OnTakePhotoListener;

public class EDialogUtil {

    public static void showTakePhotoDialog(Context context, OnTakePhotoListener listener) {

        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_take_camera);
        dialog.setSecondText(R.string.base_dialog_take_pic);
        dialog.setListener(listener);
        dialog.show();

    }


    public static void showScoreDialog(Context context, OnTakePhotoListener listener) {

        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_give_score);
        dialog.setSecondText(R.string.base_dialog_remove_score);
        dialog.setListener(listener);
        dialog.show();

    }

    public static void showStuManageDialog(Context context, OnTakePhotoListener listener) {
        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_apply_info);
//        dialog.setSecondText(R.string.base_dialog_add_vip);
//        dialog.setThirdText(R.string.base_dialog_message);
        dialog.setSecondText(R.string.base_dialog_message);
        dialog.setListener(listener);
        dialog.show();

    }

    public static void showStuDetailDialog(Context context, OnTakePhotoListener listener) {
        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_pk);
        dialog.setSecondText(R.string.base_dialog_jf);
        dialog.setThirdText(R.string.base_dialog_dhhf);
        dialog.setListener(listener);
        dialog.show();

    }

    public static void showTaskAddDialog(Context context, OnTakePhotoListener listener) {
        TakePhotoDialog dialog = new TakePhotoDialog(context);
        String[] array = ResUtil.getStrArr(context, R.array.base_task_type);
        dialog.setFirstText(array[0]);
        dialog.setSecondText(array[1]);
        dialog.setThirdText(array[2]);
        dialog.setFourthText(array[3]);
        dialog.setListener(listener);
        dialog.show();
    }

    public static void showClassDetailOption(Context context, OnTakePhotoListener listener) {
        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_course_arrange);
        dialog.setSecondText(R.string.base_dialog_parent_meet);
        dialog.setThirdText(R.string.base_dialog_class_edit);
        dialog.setFourthText(R.string.base_dialog_class_del);
        dialog.setListener(listener);
        dialog.show();
    }

    public static void showClassHourDialog(Context context, OnClassHourConfirmListener listener) {
        ClassHourDialog dialog = new ClassHourDialog(context);
        dialog.setListener(listener);
        dialog.show();
    }


    public static void showScanDialog(Context context,
                                      String headPic, String name, String msg, String time,
                                      OnBackScanListener listener) {
        ScanDialog dialog = new ScanDialog(context);
        dialog.setInfo(headPic, name, msg, time);
        dialog.setListener(listener);
        dialog.show();
    }

    public static void showReserveConfirmDialog(Context context, OnTakePhotoListener listener) {

        TakePhotoDialog dialog = new TakePhotoDialog(context);
        dialog.setFirstText(R.string.base_dialog_confirm_time);
        dialog.setListener(listener);
        dialog.show();

    }

    public static void showTextDialog(Context context, String msg, OnClassHourConfirmListener listener) {
        TextDialog dialog = new TextDialog(context);
        dialog.setMsg(msg);
        dialog.setListener(listener);
        dialog.show();
    }

    public static void showDelConfirm(Context context, String msg, OnMyAlertListener listener) {
        DelConfirmDialog dialog = new DelConfirmDialog(context);
        dialog.setMsg(msg);
        dialog.setListener(listener);
        dialog.show();
    }


}
